@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --primary: 210 79% 46%;
    --primary-foreground: 0 0% 100%;

    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;

    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 210 79% 46%;

    --radius: 0.5rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    /* 确保 body 始终可以接收点击事件 */
    pointer-events: auto !important;
  }
  
  /* 修复可能的 pointer-events 问题 */
  html, body, #root {
    pointer-events: auto !important;
  }
  
  /* 确保对话框遮罩层不会阻止所有点击 */
  [data-radix-popper-content-wrapper] {
    pointer-events: auto !important;
  }
  
  /* 确保对话框内容可以正常交互 */
  [role="dialog"] {
    pointer-events: auto !important;
  }
  
  /* 修复可能的遮罩层问题 */
  .fixed.inset-0 {
    pointer-events: auto !important;
  }
  
  /* 确保按钮和交互元素始终可点击 */
  button, a, input, select, textarea {
    pointer-events: auto !important;
  }
}

@layer components {
  .material-card {
    @apply bg-white rounded-lg shadow-material-1 hover:shadow-material-2 transition-shadow duration-200;
  }
  
  .material-button {
    @apply px-4 py-2 rounded-md font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50;
  }
  
  .material-button-primary {
    @apply material-button bg-primary text-primary-foreground hover:bg-primary/90 active:scale-95;
  }
  
  .material-button-secondary {
    @apply material-button bg-material-grey-100 text-material-grey-700 hover:bg-material-grey-200 active:scale-95;
  }
  
  .file-grid-item {
    @apply material-card p-4 cursor-pointer hover:bg-material-grey-50 transition-colors duration-200;
    /* 确保文件项可以正常点击 */
    pointer-events: auto !important;
  }
  
  .file-list-item {
    @apply flex items-center p-3 hover:bg-material-grey-50 cursor-pointer transition-colors duration-200 border-b border-material-grey-200 last:border-b-0;
    /* 确保文件项可以正常点击 */
    pointer-events: auto !important;
  }
}
